<?php

namespace Modules\Api\Http\Controllers;

use Illuminate\Http\Request;
use Modules\Api\Service\GoodsService;

class GoodsController extends BaseController
{
    /**
     *  分类商品列表
     *
     *  2019 11 25
     **/
    public function get_cate_goods_list(Request $request)
    {
        $arrInput = $request->all();

        $arr_list = GoodsService::get_cate_goods_list($arrInput);

        return response_json($arr_list);
    }

    /**
     * 指定类型商品列表
     *
     * 2019 11 25
     **/
    public function get_cate_goods_more(Request $request)
    {
        $arrInput = $request->all();

        $arr_list = GoodsService::get_cate_goods_more((array)$arrInput);

        return response_json($arr_list);
    }

    /**
     *  获取商品详情
     *
     * 2019 11 25
     **/
    public function get_goods_info(Request $request)
    {
        $nId = $request->get('id');

        $arr_list = GoodsService::get_goods_info((int)$nId);

        return response_json($arr_list);
    }

    /**
     * 商品规格属性
     *
     * 2019 11 25
     */
    public function get_goods_product(Request $request)
    {
        $nId = $request->get('id');

        $arr_list = GoodsService::get_goods_product((int)$nId);

        return response_json($arr_list);
    }

    /**
     * 个人中心推荐商品列表
     *
     * 2019 12 25
     */
    public function recommend_goods_list()
    {
        $arr_list = GoodsService::recommend_goods_list();

        return response_json($arr_list);
    }

    /**
     *  商品搜索联想
     *
     * 2020 01 06
     */
    public function suggest_list(Request $request)
    {
        $arrInput = $request->all();

        $arr_list = GoodsService::suggest_list($arrInput);

        return response_json($arr_list);
    }

    /**
     *  商品搜索接口
     *
     * 2020 01 02
     */
    public function search_goods_list(Request $request)
    {
        $arrInput = $request->all();

        $arr_list = GoodsService::search_goods_list($arrInput);

        return response_json($arr_list);
    }

    /**
     *  热门搜索
     *
     * 2020 01 02
     */
    public function hot_search_title()
    {
        $arr_list = GoodsService::hot_search_title();

        return response_json($arr_list);
    }

    /**
     *  获取商品搜索标签
     */
    public function search_goods_tag()
    {

        $arr_list = GoodsService::search_goods_tag();

        return response_json($arr_list);
    }

}